<?php

namespace App\Validate;

use App\Validate\BaseValidate;

class ResourceTotalDataValidate extends  BaseValidate
{
    //验证规则
    protected $rule = [
        'id' => 'bail|required|integer',
        'img' => 'bail|required',
        'type_id' => 'bail|required|integer',
        'title' => 'bail|required',
        'content' => 'bail|required',

        'resource_business_id' => 'bail|required|integer',
        'guid' => 'bail|required|size:32',

    ];
    //自定义验证信息
    protected $message = [
        'id.required' => 'ID不能为空',
        'id.integer' => 'ID格式不正确',
        'img.required' => '图片不能为空',
        'type_id.required' => '类型ID不能为空',
        'type_id.integer' => '类型ID格式不正确',
        'title.required' => '标题不能为空',
        'content.required' => '内容不能为空',

        'resource_business_id.required' => '资源商ID不能为空',
        'resource_business_id.integer' => '资源商ID格式不正确',
        'guid.required' => 'ID不能为空',
        'guid.size' => 'ID格式不正确',
    ];


    //自定义场景
    protected $scene = [
        'wx_add_read_duration' => ['content'], //添加用户阅读时长记录


    ];
}
